Repository navigation
fix(feeds): skip automatic requests while offline - #474
Merged
Merged
Conversation
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Opening PodNotes offline now shows cached episodes without automatic feed requests. Reconnecting refreshes missing or expired feeds once.
ensureAllhydrates before applying the online gate, so an automatic offline request cannot absorb the reconnect refresh.Fixes #460
Verification
npm run lint,npm run format:check,npm run typecheck,npm run build,npm run testwith 2,558 tests,npm run test:toolingwith 13 tests, andnpm run docs:build. Commands used Node 22 throughfnm exec --using 22 --.npm run test:e2eon a fresh isolated vault in Obsidian 1.14.4 on Linux, then withPODNOTES_OBSIDIAN_APP=/opt/Obsidian/obsidianon 1.13.7, with 188 tests each. With two expired fixture feeds and a stopped server, offline attempts fell from 2 to 0. Holding the baseline requests reproduced 0 fresh reconnect attempts; the fix made exactly 2 and updated both lists. Fixtures usehttp://podnotes.test:<port>/feed2-alpha/feed.xmland/feed2-beta/feed.xml.npm run count:writes -- start,report, andstoprecorded 3 completed writes before and after the fix, with 0 failures.npm run sizepassed at 99,052 gzip bytes, an increase of 15 bytes. Runtime screenshot.Verification logs and review reports include the failing baseline, passing runs, and mutation scripts.
Four wrong alternatives each failed a named test:
navigator.onLineinstead of the online store.automatic loading follows the online store and reconnect starts a fresh requestfailed.offline, an expired cache shows without a requestfailed.subscription changes load only when onlinefailed.a document is fetched again once it is more than six hours oldfailed.Scope
This covers automatic startup, view opening, subscription changes, and reconnect. Refresh and Retry retain their offline behavior. Cancellation of requests started online before a drop, or explicitly through a URI while offline, remains separate work.
Release impact
No settings, storage format, public API, or URI changes. No migration.
Docs at release
Update
docs/src/content/docs/podcasts.md, underWhen a feed cannot be reached, to explain cached lists appearing offline without automatic requests, missing or expired feeds refreshing on reconnect, and Refresh being unavailable offline. Published docs are unchanged.Note
Skip automatic feed requests while offline in
FeedRepository.ensureAllFeedRepository.ensureAllnow takes anonlineoption; offline calls hydrate stored feed state and return success without any network requests, while online calls use the existing load path (FeedRepository.ts)onMountinit call with a reactive effect that runsensureAllwith the current online state, so feeds load again on reconnectonline: trueensureAllsignature changed — all call sites must pass the newonlineoption; offline open shows cached episodes as stale with refresh controls disabledMacroscope summarized 873e688.